package Strategy;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import Beat.BeatBar;
import Beat.BeatObserver;
import HeartModel.HeartController;
import Principal.ControllerInterface;
import Principal.DJView;

public class ModelSelector extends DJView {
	private JButton BM, HM, MM;
	
	
	public ModelSelector(ControllerInterface controller, ModelSelector model) {	
		super(controller, model);
	}
	
	
	public ModelSelector(HeartController controller, ModelInterface model2) {
		// TODO Auto-generated constructor stub
	}


	public void createView(){
		// Create all Swing components here
        viewPanel = new JPanel(new GridLayout(4, 2));
        viewFrame = new JFrame("View");
        //viewFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        viewFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        viewFrame.setBounds(500, 125, 150, 80);
        viewFrame.setSize(new Dimension(150, 80));
        bpmOutputLabel = new JLabel("offline", SwingConstants.CENTER);
		beatBar = new BeatBar();
		beatBar.setValue(0);
		//beatBar.resize(130, arg1);
        JPanel bpmPanel = new JPanel(new GridLayout(2, 1));
		bpmPanel.add(beatBar);
        bpmPanel.add(bpmOutputLabel);
        viewPanel.add(bpmPanel);
        BM = new JButton("BM");
        BM.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent arg0) {
        		
        	}
        });
        viewPanel.add(BM);
        HM = new JButton("HM");
        HM.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent arg0) {
        		
        	}
        });
        viewPanel.add(HM);
        MM = new JButton("MM");
        MM.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent arg0) {
        		
        	}
        });
        viewPanel.add(MM);
        viewFrame.getContentPane().add(viewPanel, BorderLayout.CENTER);
        viewFrame.pack();
        
        viewFrame.setVisible(true);
        viewFrame.setLocation(585, 200); /*****************VIEW POSITION*****/
	}


	public void registerObserver(BeatObserver beatObserver) {
		// TODO Auto-generated method stub
		
	}

}
